codelens: a way to use selected launch.json configuration in run test 您所在的位置:网站首页 launch configuration run codelens: a way to use selected launch.json configuration in run test

codelens: a way to use selected launch.json configuration in run test

#codelens: a way to use selected launch.json configuration in run test | 来源: 网络整理| 查看: 265

I see what you mean. I included -test.run to match the individual function setup from run/debug test for demonstration purposes. I figured one might wonder if they should match the choice from run/debug test for this to work, without worrying about the hidden implementation details. But it does not work either way. If the two configurations had been combined as-is, we would have gotten an error like go test: run flag may be set only once, which we do not. I added a comment to highlight this above.

Interestingly, adding ["-test.run", "TestA"] to go.testFlags does lead to an error with run test and run file tests while adding ["-run", "TestA"] is a no-op for both. And adding either of those works with run package tests, which doesn't use its own -run flag by default.

If we do support this feature, it is up to us how to combine the two sources of -test.run, isn't it? We could combine everything as-is and channel the duplication errors or apply some clever logic to make sense of the choices and avoid unnecessary errors (e.g. expect them to match, or one be a superset of the other, or expect that launch configuration has none specified, or always ignore the one specified in launch configuration favor of what run/debug test or run file tests adds). Moreover, we need to sanity check mode and the program in the launch configuration as well. A user might accidentally select something not related to their test at all, in which case we could just fallback to the default configuration.

Whatever we do, we just need to make sure it is documented and also flagged via some kind of warnings/logging, so if the behavior is unexpected, the user can get an explanation without having to search forums or file issues.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有